﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;

namespace ClassLibrary1
{
    public partial class UserControl1 : UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
        }

        private void richTextBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            WebClient wc = new WebClient();
            Stream st = wc.OpenRead("http://www.isi.edu/natural-language/mt/wkbk.rtf");
            byte[] b = new byte[1024];
            MemoryStream memStream = new MemoryStream();
            int a;
            while ((a = st.Read(b,0, b.Length))>0)
            {
                memStream.Write(b, 0, a);
            }
            memStream.Flush();
            memStream.Seek(0, SeekOrigin.Begin);

            richTextBox1.LoadFile(memStream, RichTextBoxStreamType.RichText);
        }
    }
}
